﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SWCad
{
    public partial class FormMValue : Form
    {
        string[] strValueRef = {"福建|沿海区|θ>=2.5,m=0.053θ^0.785\nθ<2.5,m=0.062θ^0.613|θ=L/J^(1/3)/F^0.25|千分率|手册",
                                "福建|内地区|θ>=2.5,m=0.035θ^0.785\nθ<2.5,m=0.041θ^0.613|θ=L/J^(1/3)/F^0.25|千分率|手册"
                               };
        int iMValueNum = 2; //不同分区计算方法数量
        public IWin32Window pDlg;     
        public ClassMValueCoef cMValueC = new ClassMValueCoef();
        ClassLib formClib;  

        public FormMValue()
        {
            InitializeComponent();
            cMValueC.initCoef(strValueRef, iMValueNum); //初始赋值
            initItems();                       //初始化窗口控件
        }
        public void ShowDialog(string customID, TLJSChart parent, ClassLib clib)
        {
            this.Text = /*customID + */"汇流参数m值计算";
            pDlg = parent;

            formClib = clib;
            SetGridData();
            // Show the dialog
            this.ShowDialog(parent);
        }   
        public void initItems()
        {
            //初始化省份-福建
            cmbProvince.Items.Clear(); 
            cmbProvince.Items.Add(cMValueC.strProvince[0]);
            cmbProvince.SelectedIndex = 0;

            //初始化分区-沿海-内地
            cmbZone.Items.Clear();
            cmbZone.Items.Add(cMValueC.strZone[0]);
            cmbZone.Items.Add(cMValueC.strZone[1]);
            cmbZone.SelectedIndex = 0;

            //初始化参数公式:福建沿海
            rtextMFormular.Text = cMValueC.strMFormular[0];            

            //theta定义:福建沿海
            textTheta.Text = cMValueC.strTheta[0];

            //J的取值:福建沿海J采用方式
            textJ.Text = cMValueC.strJ[0];

            //备注
            rtextComment.Text = cMValueC.strComment[0];        
            
        }
        private void GetGridData() ///表格值传递给类变量
        {
            try
            {
                
            }
            catch
            {
                MessageBox.Show("短历时类别或频率数有误");
                return;
            }
        }
        public void SetGridData() ///变量值传给表格
        {
            try
            {
                
            }
            catch
            {
                MessageBox.Show("短历时类别或频率数有误");
                return;
            }
        }
    }
}
